<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="stripes" uri="http://stripes.sourceforge.net/stripes.tld"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
  <head><title>Stripe Stack</title></head>
<body>
    
<table border="0">
  <tr>
    <td>
      <stripes:form id="PushForm" action="/Stack.action">
        Select a number:
          <stripes:select size="1" name="numToPush">
            <stripes:option value="1">1</stripes:option>
            <stripes:option value="2">2</stripes:option>
            <stripes:option value="3">3</stripes:option>
            <stripes:option value="4">4</stripes:option>
          </stripes:select>
        <stripes:submit value="push" name="push"/>
      </stripes:form>
    </td>
    <td>
      <stripes:form id="PopForm" action="/Stack.action">
        <stripes:submit value="pop" name="pop"/>
      </stripes:form>
    </td>
    <td>
      <stripes:form id="DoubleForm" action="/Stack.action">
        <stripes:submit value="Double It" name="doubleIt"/>
      </stripes:form>
    </td>
  </tr>
 </table>

 <p>
 Current contents of stack:
 <table id="stackTable" border="1">
   <c:forEach var="element" items="${actionBean.stackIterator}">
     <tr><td>${element}</td></tr>
   </c:forEach>
 </table>

<p>
<table id="ErrorMessageTable">
  <tr><td><font color="red">${actionBean.errorMessage}</font></td></tr>
</table>

</body>
</html>

